/*
 *  Copyright 2022 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../variables.less';
@import (reference) '../fonts.less';
@import (reference) 'antd/dist/antd.variable.less';

.scrollable-card-body-sm() {
  max-height: calc(100% - @card-head-height-sm - @card-padding-base-sm);
  overflow-y: auto;
}

.scrollable-card-body() {
  max-height: calc(100% - @card-head-height - @card-padding-base);
  overflow-y: auto;
}

.ant-card {
  background: @background-color;
  border-color: @border-color;
}

.card-body-full {
  .ant-card-body {
    height: 100%;
    padding: @padding-mlg;
  }
}

.card-padding-0 {
  .ant-card-body {
    padding: 0;
  }
}

.card-padding-xss {
  > .ant-card-body {
    padding: @padding-xss;
  }
}

.card-padding-xs {
  > .ant-card-body {
    padding: @padding-xs;
  }
}

.card-padding-sm {
  > .ant-card-body {
    padding: @padding-sm;
  }
}

.card-padding-md {
  > .ant-card-body {
    padding: @padding-md;
  }
}

.card-padding-lg {
  > .ant-card-body {
    padding: @padding-lg;
  }
}

.card-padding-y-0 {
  .ant-card-body {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.card-body-border-none {
  border: none;

  .ant-card-head {
    border: none;
  }
}

.ant-card-body {
  padding: @padding-mlg;
}

.ant-card-feed > .ant-card-body {
  padding-bottom: 0px;
}

.custom-entity-schema > .CodeMirror {
  height: 70vh;
}

.ant-card-extra {
  padding: 0px;
}

.ant-card.new-header-border-card {
  height: auto !important;

  .ant-card-head {
    background: @grey-50;
    border-radius: @border-rad-sm;

    .text-sm();
    font-weight: 500;
  }

  .ant-card-body {
    height: auto !important;
    max-height: none !important;
    transition: all 200ms ease;
    transition-property: height, left, top;
  }

  .expand-collapse-icon {
    transform: rotate(180deg);
  }

  &.expanded {
    .ant-card-head {
      border-bottom: none;
      margin-bottom: 0;

      .expand-collapse-icon {
        transform: rotate(0deg);
      }
    }
  }

  &:not(.expanded) {
    .ant-card-body {
      height: 0 !important;
      overflow: hidden;
      padding: 0;
    }
  }

  .expand-collapse-icon {
    & svg {
      fill: @white;
    }
  }

  .ant-card-extra {
    margin-left: @size-sm;
  }

  border: 1px solid @grey-15;
}

.bot-page-roles-card-header {
  .ant-card-head {
    background: @grey-50;
    border-radius: @border-rad-sm;
    .text-sm();
    font-weight: 500;
    border-bottom: none;
  }

  .ant-card-body {
    height: auto !important;
    max-height: none !important;
  }
}
